# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.StorageTransfer.V1.Model.EventStream do
  @moduledoc """
  Specifies the Event-driven transfer options. Event-driven transfers listen to an event stream to transfer updated files.

  ## Attributes

  *   `eventStreamExpirationTime` (*type:* `DateTime.t`, *default:* `nil`) - Specifies the data and time at which Storage Transfer Service stops listening for events from this stream. After this time, any transfers in progress will complete, but no new transfers are initiated.
  *   `eventStreamStartTime` (*type:* `DateTime.t`, *default:* `nil`) - Specifies the date and time that Storage Transfer Service starts listening for events from this stream. If no start time is specified or start time is in the past, Storage Transfer Service starts listening immediately.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. Specifies a unique name of the resource such as AWS SQS ARN in the form 'arn:aws:sqs:region:account_id:queue_name', or Pub/Sub subscription resource name in the form 'projects/{project}/subscriptions/{sub}'.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :eventStreamExpirationTime => DateTime.t() | nil,
          :eventStreamStartTime => DateTime.t() | nil,
          :name => String.t() | nil
        }

  field(:eventStreamExpirationTime, as: DateTime)
  field(:eventStreamStartTime, as: DateTime)
  field(:name)
end

defimpl Poison.Decoder, for: GoogleApi.StorageTransfer.V1.Model.EventStream do
  def decode(value, options) do
    GoogleApi.StorageTransfer.V1.Model.EventStream.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.StorageTransfer.V1.Model.EventStream do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
